home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3 / Vk / VkMenu.z / VkMenu
Encoding:
Text File  |  2002-10-03  |  31.0 KB  |  859 lines

  1.  
  2.  
  3.  
  4. VVVVkkkkMMMMeeeennnnuuuu((((3333xxxx))))                                                          VVVVkkkkMMMMeeeennnnuuuu((((3333xxxx))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      VkMenu - Abstract base class for all ViewKit menu container objects
  10.  
  11. IIIINNNNHHHHEEEERRRRIIIITTTTSSSS FFFFRRRROOOOMMMM
  12.      VkMenuItem : VkComponent : VkCallbackObject
  13.  
  14. HHHHEEEEAAAADDDDEEEERRRR FFFFIIIILLLLEEEE
  15.      #include <Vk/VkMenu.h>
  16.  
  17. PPPPUUUUBBBBLLLLIIIICCCC PPPPRRRROOOOTTTTOOOOCCCCOOOOLLLL SSSSUUUUMMMMMMMMAAAARRRRYYYY
  18.    AAAAddddddddiiiinnnngggg IIIItttteeeemmmmssss
  19.            VkMenuAction       *addAction(const char    *name,
  20.                                          XtCallbackProc func,
  21.                                          XtPointer      data,
  22.                                          int            pos = -1);
  23.  
  24.            VkMenuAction       *addAction(const char     *name,
  25.                                          XtCallbackProc  func,
  26.                                          XtCallbackProc  undoCallabck,
  27.                                          XtPointer       data,
  28.                                          int             pos = -1);
  29.  
  30.            VkMenuActionWidget *addActionWidget(const char     *name,
  31.                                            XtCallbackProc  func,
  32.                                            XtPointer       data,
  33.                                            int             pos = -1);
  34.  
  35.            VkMenuActionWidget *addActionWidget(const char     *name,
  36.                                            XtCallbackProc  func,
  37.                                            XtCallbackProc  undoCallback,
  38.                                            XtPointer       data,
  39.                                            int             pos = -1);
  40.  
  41.            VkMenuConfirmFirstAction
  42.                         *addConfirmFirstAction(const char    *name,
  43.                                            XtCallbackProc func,
  44.                                            XtPointer      data,
  45.                                            int            pos = -1);
  46.  
  47.            VkMenuSeparator    *addSeparator(int pos = -1);
  48.            VkMenuLabel        *addLabel(const char *name,
  49.                                         int pos = -1);
  50.  
  51.            VkMenuToggle       *addToggle(const char     *name,
  52.                                      XtCallbackProc  func,
  53.                                      XtPointer       data,
  54.                                      int             state = -1,
  55.                                      int             pos = -1);
  56.  
  57.            VkMenuToggle       *addToggle(const char     *name,
  58.                                      XtCallbackProc  func,
  59.                                      XtCallbackProc  undoCallback,
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. VVVVkkkkMMMMeeeennnnuuuu((((3333xxxx))))                                                          VVVVkkkkMMMMeeeennnnuuuu((((3333xxxx))))
  71.  
  72.  
  73.  
  74.                                      XtPointer       data,
  75.                                      int             state = -1,
  76.                                      int             pos = -1);
  77.  
  78.            void                add(VkMenuItem *name,  int pos = -1);
  79.  
  80.            VkSubMenu *addSubmenu(VkSubMenu *submenu, int pos = -1);
  81.  
  82.            VkSubMenu *addSubmenu(const char *name, int pos = -1);
  83.  
  84.            VkSubMenu *addSubmenu(const char *name,
  85.                                  VkMenuDesc *desc,
  86.                                  XtPointer   defaultClientData = NULL);
  87.  
  88.            VkRadioSubMenu *addRadioSubmenu(VkRadioSubMenu *submenu,
  89.                                            int pos = -1);
  90.  
  91.            VkRadioSubMenu *addRadioSubmenu(const char *name, int pos = -1);
  92.  
  93.            VkRadioSubMenu *addRadioSubmenu(const char *name,
  94.                                            VkMenuDesc *desc,
  95.                                            XtPointer   defaultClientData = NULL);
  96.  
  97.  
  98.    MMMMaaaannnniiiippppuuuullllaaaattttiiiinnnngggg IIIItttteeeemmmmssss
  99.            VkMenuItem *findNamedItem(const char *name,
  100.                                      Boolean     caseless = FALSE);
  101.  
  102.            VkMenuItem *removeItem(const char *name);
  103.            VkMenuItem *activateItem(const char *name );
  104.            VkMenuItem *deactivateItem(const char *name );
  105.            VkMenuItem *replace(const char *name , VkMenuItem *item );
  106.  
  107.  
  108.    AAAAcccccccceeeessssssss FFFFuuuunnnnccccttttiiiioooonnnnssss
  109.            virtual VkMenuItemType menuType () = 0;
  110.            virtual const char* className();
  111.            Boolean isContainer();
  112.            int getItemPosition(VkMenuItem* item);
  113.            int getItemPosition(char *name);
  114.            int getItemPosition(Widget);
  115.            VkMenuItem * operator[] (int index) const;
  116.            int numItems() const;
  117.  
  118.  
  119.    AAAAcccccccceeeessssssss FFFFuuuunnnnccccttttiiiioooonnnnssss ---- VVVViiiieeeewwwwKKKKiiiitttt 2222....1111 oooonnnnllllyyyy
  120.            VkScreen *getScreen();
  121.  
  122.  
  123.    CCCCoooonnnnttttrrrroooollll FFFFuuuunnnnccccttttiiiioooonnnnssss
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. VVVVkkkkMMMMeeeennnnuuuu((((3333xxxx))))                                                          VVVVkkkkMMMMeeeennnnuuuu((((3333xxxx))))
  137.  
  138.  
  139.  
  140.            static void useOverlayMenus(const Boolean flag);
  141.            static void useWorkProcs(Boolean flag);
  142.  
  143.  
  144. CCCCLLLLAAAASSSSSSSS DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  145.      VkMenu is an abstract base class that implements the bulk of the
  146.      functionality needed for all menus, including menubars (see
  147.      VkMenuBar(3X)), pulldowns, (see VkSubMenu(3x)), option menus (see
  148.      VkOptionMenu(3X)), and popup menus (see (VkPopupMenu(3X)). Menus can be
  149.      built by passing a static description to the constructor of a class
  150.      derived from VkMenu or by adding items dynamically. The two approaches
  151.      can be mixed; an initial menu structure can be defined statically, and
  152.      then additional items can be added dynamically as needed.
  153.  
  154.    UUUUssssiiiinnnngggg SSSSttttaaaattttiiiicccc MMMMeeeennnnuuuu DDDDeeeessssccccrrrriiiippppttttiiiioooonnnnssss
  155.      Menus can be described statically using an array of structures of type
  156.      VkMenuDesc. This structure is defined as follows:
  157.  
  158.  
  159.            struct VkMenuDesc {
  160.               VkMenuItemType       menuType;
  161.               char                *name;
  162.               XtCallbackProc       callback;
  163.               VkMenuDesc          *submenu;
  164.               XtPointer            clientData;
  165.               XtCallbackProc       undoCallback;
  166.            };
  167.  
  168.  
  169.  
  170.      Menu hierarchies can be defined by creating connected arrays of this
  171.      structure.  The first member of this structure indicates a menu type
  172.      using the enumerated VkMenuItemType defined in VkMenuItem.h. The possible
  173.      values are:
  174.  
  175.    AAAACCCCTTTTIIIIOOOONNNN
  176.           A "normal" menu item, implemented as a VkMenuAction object
  177.  
  178.    CCCCOOOONNNNFFFFIIIIRRRRMMMMFFFFIIIIRRRRSSSSTTTTAAAACCCCTTTTIIIIOOOONNNN
  179.           An action that will not be executed without user confirmation.
  180.  
  181.    AAAACCCCTTTTIIIIOOOONNNNWWWWIIIIDDDDGGGGEEEETTTT
  182.           A "normal" menu item, implemented as a VkMenuActionWidget object.
  183.           (This class uses a widget instead of a gadget.)
  184.  
  185.    SSSSUUUUBBBBMMMMEEEENNNNUUUU
  186.           A cascading submenu, implemented as a VkSubMenu object
  187.  
  188.    RRRRAAAADDDDIIIIOOOOSSSSUUUUBBBBMMMMEEEENNNNUUUU
  189.           Same as above, but forced to act as a radio-style pane, implemented
  190.           as a VkRadioSubMenu object.
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. VVVVkkkkMMMMeeeennnnuuuu((((3333xxxx))))                                                          VVVVkkkkMMMMeeeennnnuuuu((((3333xxxx))))
  203.  
  204.  
  205.  
  206.    SSSSEEEEPPPPAAAARRRRAAAATTTTOOOORRRR
  207.           A separator, implemented as an VkMenuSeparator object
  208.  
  209.    LLLLAAAABBBBEEEELLLL
  210.           A label, implemented as a VkMenuLabel object
  211.  
  212.    TTTTOOOOGGGGGGGGLLLLEEEE
  213.           A two-state toggle button gadget, implemented as a VkMenuToggle
  214.           object
  215.  
  216.    OOOOPPPPTTTTIIIIOOOONNNN
  217.           A multi-choice option menu, implemented as a VkOptionMenu object.
  218.           This option would rarely be used in a menu description.
  219.  
  220.    PPPPOOOOPPPPUUUUPPPP
  221.           A popup menu pane, implemented as a VkPopupMenu object.This option
  222.           would rarely be used in a menu description.
  223.  
  224.    BBBBAAAARRRR
  225.           A menu bar, implemented as a VkPopupMenu object.This option would
  226.           rarely be used in a menu description.
  227.  
  228.    EEEENNNNDDDD
  229.           All menu descriptions must be terminated by this constant.
  230.  
  231.      For example, assume you want to create a menu that contains two submenus,
  232.      each of which contain two selectable actions. This menu could be
  233.      described as follows:
  234.  
  235.  
  236.            VkMenuDesc applicationPane[] = {
  237.             { ACTION,   "itemOne",     oneCallback},
  238.             { ACTION,   "itemTwo",     twoCallback},
  239.             { END},
  240.            };
  241.  
  242.            VkMenuDesc editPane[] = {
  243.             { ACTION,   "cut",     cutCallback},
  244.             { ACTION,   "paste",   pasteCallback},
  245.             { END},
  246.            };
  247.  
  248.            VkMenuDesc  menu[] = {
  249.             { SUBMENU, "Application",  NULL, applicationPane},
  250.             { SUBMENU, "Edit",         NULL, editPane},
  251.             { END}
  252.            };
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.                                                                         PPPPaaaaggggeeee 4444
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268. VVVVkkkkMMMMeeeennnnuuuu((((3333xxxx))))                                                          VVVVkkkkMMMMeeeennnnuuuu((((3333xxxx))))
  269.  
  270.  
  271.  
  272.      All the various objects needed to implement this menu hierarchy could
  273.      then be create as follows:
  274.  
  275.             VkMenuBar *menubar = VkMenuBar(menu);
  276.  
  277.  
  278.    UUUUssssiiiinnnngggg SSSSttttaaaattttiiiicccc DDDDeeeessssccccrrrriiiippppttttiiiioooonnnnssss WWWWiiiitttthhhh VVVVkkkkWWWWiiiinnnnddddoooowwww
  279.      When using static descriptions with classes derived from VkWindow, it is
  280.      recommended that both callbacks and menu structures be declared as
  281.      members of the class. For example, the following class creates a menubar
  282.      that matches the menu hierarchy described above.
  283.  
  284.  
  285.            class Sample: public VkWindow {
  286.  
  287.              private:
  288.  
  289.               static void oneCallback( Widget,
  290.                                        XtPointer,
  291.                                        XtPointer);
  292.               static void twoCallback( Widget,
  293.                                        XtPointer ,
  294.                                        XtPointer);
  295.               static void cutCallback( Widget,
  296.                                        XtPointer,
  297.                                        XtPointer);
  298.               static void pasteCallback( Widget,
  299.                                          XtPointer ,
  300.                                          XtPointer);
  301.  
  302.               static VkMenuDesc applicationPane[];
  303.               static VkMenuDesc editPane[];
  304.               static VkMenuDesc menu[];
  305.  
  306.             protected:
  307.  
  308.             public:
  309.  
  310.               Sample( const char *name) : VkWindow( name)
  311.  
  312.               // Other members
  313.            };
  314.  
  315.  
  316.      The constructor of this class can install this menu in several ways.
  317.      This example installs the menu bar using the complete description:
  318.  
  319.  
  320.            SampleWindow::SampleWindow(char *name) : VkWindow(name)
  321.            {
  322.                setMenuBar(menu);
  323.  
  324.  
  325.  
  326.  
  327.                                                                         PPPPaaaaggggeeee 5555
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334. VVVVkkkkMMMMeeeennnnuuuu((((3333xxxx))))                                                          VVVVkkkkMMMMeeeennnnuuuu((((3333xxxx))))
  335.  
  336.  
  337.  
  338.                 // Other actions
  339.            }
  340.  
  341.  
  342.      This example instantiates a menu bar and installs the object:
  343.  
  344.  
  345.            SampleWindow::SampleWindow(char *name) : VkWindow(name)
  346.            {
  347.                 setMenuBar(new VkMenuBar(menu, (XtPointer) this));
  348.                 // Other actions
  349.            }
  350.  
  351.  
  352.  
  353.      Note that the top level description in this case is not strictly
  354.      required.  A menubar could be added to a VkWindow  subclass by adding
  355.      each pane individually. For example:
  356.  
  357.  
  358.            SampleWindow::SampleWindow(char *name) : VkWindow(name)
  359.            {
  360.                addMenuPane("Application", application);
  361.                addMenuPane("Edit", edit);
  362.  
  363.                // Other actions
  364.            }
  365.  
  366.  
  367.  
  368.      Although the above example shows a menu bar, the same description could
  369.      be used to create other types of menus. For example, the following code
  370.      segment creates a popup menu in addition to a menu bar, using the same
  371.      description:
  372.  
  373.  
  374.            SampleWindow::SampleWindow(char *name) : VkWindow(name)
  375.            {
  376.                 // Create the menu bar
  377.  
  378.                addMenuPane("Application", application);
  379.                addMenuPane("Edit", edit);
  380.  
  381.                // Create a popup that has the same
  382.                // contents as the menubar
  383.  
  384.                VkPopupMenu *popup = new VkPopupMenu(menu);
  385.                // Other actions
  386.             }
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.                                                                         PPPPaaaaggggeeee 6666
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400. VVVVkkkkMMMMeeeennnnuuuu((((3333xxxx))))                                                          VVVVkkkkMMMMeeeennnnuuuu((((3333xxxx))))
  401.  
  402.  
  403.  
  404.    CCCCrrrreeeeaaaattttiiiinnnngggg MMMMeeeennnnuuuussss DDDDyyyynnnnaaaammmmiiiiccccaaaallllllllyyyy
  405.      Regardless of the menu type, items can be added dynamically using the
  406.      protocol defined by VkMenu. For example, the menu bar constructed
  407.      statically above can be created dynamically with the following code
  408.      segment:
  409.  
  410.  
  411.            VkMenuBar *menuBar     = new VkMenuBar();
  412.            VkSubMenu *application =
  413.                             menuBar->addSubMenu("Application");
  414.            VkSubMenu *edit        = menuBar->addSubMenu("Edit");
  415.  
  416.            application->addAction("itemOne", oneCallback);
  417.            application->addAction("itemTwo", twoCallback);
  418.  
  419.            edit->addAction("cut", cutCallback);
  420.            edit->addAction("paste", pasteCallback);
  421.  
  422.  
  423.  
  424.    DDDDeeeerrrriiiivvvviiiinnnngggg SSSSuuuubbbbccccllllaaaasssssssseeeessss
  425.      Specific types of menus are implemented as derived classes of VkMenu.
  426.      These include VkOptionMenu, VkPopupMenu, VkMenuBar, VkSubMenu, and
  427.      VkRadioSubMenu. The VkMenu class is not necessarily designed to support
  428.      other derivations.
  429.  
  430. FFFFUUUUNNNNCCCCTTTTIIIIOOOONNNN DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNNSSSS
  431.    aaaaddddddddAAAAccccttttiiiioooonnnn
  432.            VkMenuAction       *addAction(const char     *name,
  433.                                      XtCallbackProc func,
  434.                                      XtPointer      data,
  435.                                      int            pos = -1);
  436.  
  437.            VkMenuAction       *addAction(const char     *name,
  438.                                      XtCallbackProc  func,
  439.                                      XtCallbackProc  undoCallabck,
  440.                                      XtPointer       data,
  441.                                      int              pos = -1);
  442.  
  443.  
  444.           Creates and adds an action object to a menu. The first argument
  445.           indicates the name, the second specifies a callback function. The
  446.           final two arguments can be used to specify some client data for the
  447.           callback, and a position within the menu for this item. In the
  448.           second form of this function, it is possible to add a callback to be
  449.           called if the menu action is to be undone.  If the first form of
  450.           this function is used, the action cannot be undone and does not
  451.           participate in the undo mechanism. (See VkMenuUndoManager(3X)).
  452.  
  453.    aaaaddddddddAAAAccccttttiiiioooonnnnWWWWiiiiddddggggeeeetttt
  454.  
  455.  
  456.  
  457.  
  458.  
  459.                                                                         PPPPaaaaggggeeee 7777
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466. VVVVkkkkMMMMeeeennnnuuuu((((3333xxxx))))                                                          VVVVkkkkMMMMeeeennnnuuuu((((3333xxxx))))
  467.  
  468.  
  469.  
  470.            VkMenuActionWidget *addActionWidget(const char     *name,
  471.                                            XtCallbackProc func,
  472.                                            XtPointer      data,
  473.                                            int            pos = -1);
  474.  
  475.            VkMenuActionWidget *addActionWidget(const char     *name,
  476.                                           XtCallbackProc  func,
  477.                                           XtCallbackProc  undoCallback,
  478.                                           XtPointer       data,
  479.                                           int             pos = -1);
  480.  
  481.  
  482.           Functionally equivalent to _a_d_d_A_c_t_i_o_n(), but forces the menu system
  483.           to create a widget, as opposed to a gadget. Gadgets are used by
  484.           default.
  485.  
  486.    aaaaddddddddCCCCoooonnnnffffiiiirrrrmmmmFFFFiiiirrrrssssttttAAAAccccttttiiiioooonnnn
  487.            VkMenuConfirmFirstAction
  488.                  *addConfirmFirstAction(const char *,
  489.                                         XtCallbackProc func,
  490.                                         XtPointer data,
  491.                                        int pos = -1);
  492.  
  493.  
  494.           Some actions are potentially dangerous and/or cannot be reversed.
  495.           Quitting an application might be one example. The function
  496.           _a_d_d_C_o_n_f_i_r_m_F_i_r_s_t_A_c_t_i_o_n() adds an action to a menu that automatically
  497.           posts a confirming dialog before executing the command. Otherwise,
  498.           the function is equivalent to _a_d_d_A_c_t_i_o_n() without the option of an
  499.           undo callback.
  500.  
  501.    aaaaddddddddSSSSeeeeppppaaaarrrraaaattttoooorrrr
  502.            VkMenuSeparator    *addSeparator(int pos = -1);
  503.  
  504.  
  505.           Adds a separator item to a menu.
  506.  
  507.    aaaaddddddddLLLLaaaabbbbeeeellll
  508.            VkMenuLabel        *addLabel(const char *, int pos = -1);
  509.  
  510.  
  511.           Add a non-selectable label item to a menu.
  512.  
  513.    aaaaddddddddTTTToooogggggggglllleeee
  514.            VkMenuToggle       *addToggle(const char *,
  515.                                          XtCallbackProc func,
  516.                                          XtPointer data,
  517.                                          int state = -1,
  518.                                          int pos = -1);
  519.            VkMenuToggle       *addToggle(const char *,
  520.                                          XtCallbackProc func,
  521.                                          XtCallbackProc undoCallback,
  522.  
  523.  
  524.  
  525.                                                                         PPPPaaaaggggeeee 8888
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532. VVVVkkkkMMMMeeeennnnuuuu((((3333xxxx))))                                                          VVVVkkkkMMMMeeeennnnuuuu((((3333xxxx))))
  533.  
  534.  
  535.  
  536.                                          XtPointer data,
  537.                                          int state = -1,
  538.                                          int pos = -1);
  539.  
  540.  
  541.           Adds a toggle item to a menu. All arguments serve the same purpose
  542.           as those in _a_d_d_A_c_t_i_o_n(). An additional, optional argument, state,
  543.           allows the initial state of the item to be specified.
  544.  
  545.    aaaadddddddd
  546.            void  add(VkMenuItem *, int pos = -1);
  547.  
  548.  
  549.           This function allows an arbitrary instance of a VkMenuItem subclass
  550.           to be added to a menu. This function is intended primarily to
  551.           support new derived classes not currently supported by the ViewKit.
  552.  
  553.    aaaaddddddddSSSSuuuubbbbmmmmeeeennnnuuuu
  554.            VkSubMenu *addSubmenu(VkSubMenu *submenu, int pos = -1);
  555.            VkSubMenu *addSubmenu(const char *name, int pos = -1);
  556.            VkSubMenu *addSubmenu(const char *name,
  557.                                  VkMenuDesc*,
  558.                                   XtPointer defaultClientData = NULL);
  559.  
  560.  
  561.           Installs a VkSubMenu object into a menu.  The first form adds an
  562.           existing VkSubMenu instance. The second form creates and returns an
  563.           instance containing no items, while the third form creates a
  564.           VkSubMenu from the given static menu description.
  565.  
  566.    aaaaddddddddRRRRaaaaddddiiiiooooSSSSuuuubbbbmmmmeeeennnnuuuu
  567.            VkRadioSubMenu *addRadioSubmenu(VkRadioSubMenu *submenu,
  568.                                            int pos = -1);
  569.            VkRadioSubMenu *addRadioSubmenu(const char *name,
  570.                                            int pos = -1);
  571.            VkRadioSubMenu *addRadioSubmenu(const char *name,
  572.                                    VkMenuDesc*,
  573.                                    XtPointer defaultClientData = NULL);
  574.  
  575.  
  576.           These functions have the same behavior as _a_d_d_S_u_b_M_e_n_u(), except that
  577.           the new submenu pane is configured as a radio box.
  578.  
  579.    bbbbuuuuiiiilllldddd(((())))
  580.            void build(Widget parent);
  581.  
  582.  
  583.           It is possible to need a menu item to exist, but to not want it to
  584.           be visible on the screen. For example, an application might start up
  585.           with some menu panes hidden from view, to appear when the
  586.           application's state changes. To display a menu hierarchy without
  587.           forcing _a_l_l items to become visible, call _b_u_i_l_d(), with a parent
  588.  
  589.  
  590.  
  591.                                                                         PPPPaaaaggggeeee 9999
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598. VVVVkkkkMMMMeeeennnnuuuu((((3333xxxx))))                                                          VVVVkkkkMMMMeeeennnnuuuu((((3333xxxx))))
  599.  
  600.  
  601.  
  602.           widget.
  603.  
  604.  
  605.    ffffiiiinnnnddddNNNNaaaammmmeeeeddddIIIItttteeeemmmm
  606.            VkMenuItem *findNamedItem(const char *name,
  607.                                      Boolean caseless = FALSE);
  608.  
  609.  
  610.           Finds and returns a menu item of the specified name starting at the
  611.           point in the menu hierarchy represented by the object for which this
  612.           function is called. If caseless is TRUE, the search is case-
  613.           insensitive. If no object with the given name is found, the function
  614.           returns NULL. If multiple instances of the same name exist, the
  615.           function returns the first name found in a depth-first search. Note
  616.           that it may be necessary to cast the return value if a specific type
  617.           of item is needed. For example:
  618.  
  619.  
  620.            VkMenuToggle * toggle;
  621.  
  622.            toggle = (VkMenuToggle*)
  623.                        pane->findNamedItem("toggle1");
  624.  
  625.  
  626.  
  627.    rrrreeeemmmmoooovvvveeeeIIIItttteeeemmmm
  628.            VkMenuItem *removeItem(const char *name);
  629.  
  630.  
  631.           Removes the named item from this menu. The removed item is returned.
  632.           This is functionally equivalent to:
  633.  
  634.  
  635.            (menu->findNamedItem(name))->remove();
  636.  
  637.    aaaaccccttttiiiivvvvaaaatttteeeeIIIItttteeeemmmm
  638.            VkMenuItem *activateItem(const char * );
  639.  
  640.  
  641.           Activates and returns the named item. This is functionally
  642.           equivalent to:
  643.  
  644.  
  645.            (menu->findNamedItem(name))->activate();
  646.  
  647.    ddddeeeeaaaaccccttttiiiivvvvaaaatttteeeeIIIItttteeeemmmm
  648.            VkMenuItem *deactivateItem(const char * );
  649.  
  650.  
  651.           Deactivates and returns the named item. This is functionally
  652.           equivalent to:
  653.  
  654.  
  655.  
  656.  
  657.                                                                        PPPPaaaaggggeeee 11110000
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664. VVVVkkkkMMMMeeeennnnuuuu((((3333xxxx))))                                                          VVVVkkkkMMMMeeeennnnuuuu((((3333xxxx))))
  665.  
  666.  
  667.  
  668.            (menu->findNamedItem(name))->deactivate();
  669.  
  670.    rrrreeeeppppllllaaaacccceeee
  671.            VkMenuItem *replace(const char *name ,
  672.                                VkMenuItem * newItem);
  673.  
  674.  
  675.           Replace the named item with the specified item. This function
  676.           returns the replaced item.
  677.  
  678.    mmmmeeeennnnuuuuTTTTyyyyppppeeee
  679.            virtual VkMenuItemType menuType() = 0;
  680.  
  681.  
  682.           Identifies the type of a VkMenu subclass. Possible types are BAR,
  683.           POPUP, SUBMENU, OPTION.
  684.  
  685.    ccccllllaaaassssssssNNNNaaaammmmeeee
  686.            virtual const char* className();
  687.  
  688.  
  689.           This function returns 'VkMenu" for this class.
  690.  
  691.    iiiissssCCCCoooonnnnttttaaaaiiiinnnneeeerrrr
  692.            Boolean isContainer();
  693.  
  694.  
  695.           This function returns TRUE for VkMenu and all derived classes
  696.  
  697.    ggggeeeettttSSSSccccrrrreeeeeeeennnn ---- VVVViiiieeeewwwwKKKKiiiitttt 2222....1111 oooonnnnllllyyyy
  698.            VkScreen *getScreen();
  699.  
  700.  
  701.           Return the VkScreen object associated with this menu.
  702.  
  703.    ggggeeeettttIIIItttteeeemmmmPPPPoooossssiiiittttiiiioooonnnn
  704.            int getItemPosition(VkMenuItem*);
  705.            int getItemPosition(char *name);
  706.            int getItemPosition(Widget);
  707.  
  708.  
  709.           Returns the position of a given menu item within this menu.
  710.  
  711.    ooooppppeeeerrrraaaattttoooorrrr[[[[]]]]
  712.            VkMenuItem * operator[] (int index) const;
  713.  
  714.  
  715.           Returns the indexed child of a menu.
  716.  
  717.    nnnnuuuummmmIIIItttteeeemmmmssss
  718.  
  719.  
  720.  
  721.  
  722.  
  723.                                                                        PPPPaaaaggggeeee 11111111
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730. VVVVkkkkMMMMeeeennnnuuuu((((3333xxxx))))                                                          VVVVkkkkMMMMeeeennnnuuuu((((3333xxxx))))
  731.  
  732.  
  733.  
  734.            int numItems() const;
  735.  
  736.  
  737.           Returns the number of items currently in a menu.
  738.  
  739.  
  740.    uuuusssseeeeOOOOvvvveeeerrrrllllaaaayyyyMMMMeeeennnnuuuussss
  741.            static void useOverlayMenus(const Boolean flag);
  742.            See _M_E_N_U_S _I_N _T_H_E _O_V_E_R_L_A_Y _P_L_A_N_E_S in VkSubMenu(3).
  743.  
  744.  
  745.           Puts all menus in the overlay planes.
  746.  
  747.    uuuusssseeeeWWWWoooorrrrkkkkPPPPrrrrooooccccssss
  748.            static void useWorkProcs(Boolean flag);
  749.  
  750.  
  751.           If TRUE (the default value), application startup time is improved
  752.           because menus are built using a workproc.  An application might wish
  753.           to turn this off if there is a conflict with its own workproc usage.
  754.  
  755. EEEEXXXXAAAAMMMMPPPPLLLLEEEESSSS
  756. IIIINNNNHHHHEEEERRRRIIIITTTTEEEEDDDD MMMMEEEEMMMMBBBBEEEERRRR FFFFUUUUNNNNCCCCTTTTIIIIOOOONNNNSSSS
  757.    IIIInnnnhhhheeeerrrriiiitttteeeedddd ffffrrrroooommmm VVVVkkkkMMMMeeeennnnuuuuIIIItttteeeemmmm
  758.           show(), hide(), manageAll(), setLabel(), setPosition(), activate(),
  759.           deactivate(), remove(), show(), _position, _isBuilt, _sensitive,
  760.           _parentMenu, _label, _isHidden, _unmanagedWidgets,
  761.           _numUnmanagedWidgets,
  762.  
  763.  
  764.    IIIInnnnhhhheeeerrrriiiitttteeeedddd ffffrrrroooommmm VVVVkkkkCCCCoooommmmppppoooonnnneeeennnntttt
  765.           installDestroyHandler(), removeDestroyHandler(), widgetDestroyed(),
  766.           setDefaultResources(), getResources(), manage(), unmanage(),
  767.           baseWidget(), okToQuit(), _name, _baseWidget, _w, deleteCallback
  768.  
  769.  
  770.    IIIInnnnhhhheeeerrrriiiitttteeeedddd ffffrrrroooommmm VVVVkkkkCCCCaaaallllllllbbbbaaaacccckkkkOOOObbbbjjjjeeeecccctttt
  771.           callCallbacks(), addCallback(), removeCallback(),
  772.           removeAllCallbacks()
  773.  
  774.  
  775. KKKKNNNNOOOOWWWWNNNN DDDDEEEERRRRIIIIVVVVEEEEDDDD CCCCLLLLAAAASSSSSSSSEEEESSSS
  776.      VkOptionMenu, VkSubMenu, VkHelpPane, VkRadioSubMenu, VkMenuBar,
  777.      VkPopupMenu,
  778.  
  779. CCCCLLLLAAAASSSSSSSSEEEESSSS UUUUSSSSEEEEDDDD BBBBYYYY TTTTHHHHIIIISSSS CCCCLLLLAAAASSSSSSSS
  780.      VkMenuAction, VkMenuActionWidget, VkMenuConfirmFirstAction, VkMenuItem,
  781.      VkMenuLabel, VkMenuSeparator, VkMenuToggle, VkRadioSubMenu, VkSubMenu
  782.  
  783.  
  784.  
  785.  
  786.  
  787.  
  788.  
  789.                                                                        PPPPaaaaggggeeee 11112222
  790.  
  791.  
  792.  
  793.  
  794.  
  795.  
  796. VVVVkkkkMMMMeeeennnnuuuu((((3333xxxx))))                                                          VVVVkkkkMMMMeeeennnnuuuu((((3333xxxx))))
  797.  
  798.  
  799.  
  800. KNOWN CLASSES THAT USE THIS CLASS
  801.      VkAlignmentGroup, VkGraph, VkHelpPane, VkMenu, VkMenuBar, VkMenuItem,
  802.      VkWindow
  803.  
  804. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  805.      VkMenuItem, VkComponent, VkAlignmentGroup, VkGraph, VkHelpPane,
  806.      VkMenuAction, VkMenuActionWidget, VkMenuBar, VkMenuConfirmFirstAction,
  807.      VkMenuItem, VkMenuLabel, VkMenuSeparator, VkMenuToggle, VkRadioSubMenu,
  808.      VkSubMenu, VkWindow
  809.      _V_i_e_w_K_i_t _P_r_o_g_r_a_m_m_e_r'_s _G_u_i_d_e
  810.      _T_h_e _X _W_i_n_d_o_w _S_y_s_t_e_m, DEC Press, Bob Sheifler and Jim Gettys
  811.      _T_h_e _X _W_i_n_d_o_w _S_y_s_t_e_m _T_o_o_l_k_i_t, DEC Press, Paul Asente and Ralph Swick
  812.      _T_h_e _O_S_F/_M_o_t_i_f _P_r_o_g_r_a_m_m_e_r_s _R_e_f_e_r_e_n_c_e, Prentice Hall, OSF
  813.  
  814.  
  815.  
  816.  
  817.  
  818.  
  819.  
  820.  
  821.  
  822.  
  823.  
  824.  
  825.  
  826.  
  827.  
  828.  
  829.  
  830.  
  831.  
  832.  
  833.  
  834.  
  835.  
  836.  
  837.  
  838.  
  839.  
  840.  
  841.  
  842.  
  843.  
  844.  
  845.  
  846.  
  847.  
  848.  
  849.  
  850.  
  851.  
  852.  
  853.  
  854.  
  855.                                                                        PPPPaaaaggggeeee 11113333
  856.  
  857.  
  858.  
  859.